package interfaz;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Nerea
 */
public class PanelListaSensores extends javax.swing.JPanel {

	 // Variables declaration - do not modify
    private javax.swing.JButton bAtras;
    private javax.swing.JButton bModificar;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lTitulo;
    private javax.swing.JTable tabla;
    private PanelInicial panelInicial;
    private PanelMenu panelMenu;
    // End of variables declaration
    
    /**
     * Creates new form PanelListaSensores
     */
    public PanelListaSensores(PanelInicial pI, PanelMenu pM) {
       
    	panelInicial = pI;
    	panelMenu = pM;
        jScrollPane1 = new javax.swing.JScrollPane();
        tabla = new javax.swing.JTable();
        bAtras = new javax.swing.JButton();
        bModificar = new javax.swing.JButton();
        lTitulo = new javax.swing.JLabel();

        setLayout(null);

        tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Id_Sensor", "Descripcion", "Estado"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tabla);

        add(jScrollPane1);
        jScrollPane1.setBounds(110, 100, 550, 370);

        bAtras.setText("Atras");
        bAtras.addMouseListener(new MouseListener() {
			public void mouseClicked(MouseEvent evt) {
				menu(evt);
			}

			public void mouseEntered(MouseEvent arg0) {

			}

			public void mouseExited(MouseEvent arg0) {

			}

			public void mousePressed(MouseEvent arg0) {	   }

			public void mouseReleased(MouseEvent arg0) {	}
		});
        add(bAtras);
        bAtras.setBounds(110, 520, 70, 30);

        bModificar.setText("Modificar");
        bModificar.addMouseListener(new MouseListener() {
			public void mouseClicked(MouseEvent evt) {
			}

			public void mouseEntered(MouseEvent arg0) {

			}

			public void mouseExited(MouseEvent arg0) {

			}

			public void mousePressed(MouseEvent arg0) {	   }

			public void mouseReleased(MouseEvent arg0) {	}
		});
        add(bModificar);
        bModificar.setBounds(570, 520, 90, 30);

        lTitulo.setFont(new java.awt.Font("Tempus Sans ITC", 1, 24)); // NOI18N
        lTitulo.setText("Lista de sensores");
        add(lTitulo);
        lTitulo.setBounds(110, 40, 400, 30);

    }// </editor-fold>
    
    private void menu(MouseEvent evt) {
		this.setVisible(false);
		panelInicial.ventana.getContentPane().add(panelMenu, 0);
		panelMenu.setVisible(true);
	}
   
}

